Learn R Programming

cosa (version 2.0.0)

Vectorize BCOSA: Vectorizes BCOSA Solutions

Description

Vectorizes BCOSA solutions based on multiple sets of parameter values. This is particularly useful when multiple designs are to be considered.

Usage

vectorize.cosa(design, args.grid, args.names = NULL, ordered = TRUE, ncase = 10L)

Arguments

design

an object returned from one of the cosa.<design>() functions.

args.grid

vector or matrix: arguments' grid consisting of sets of parameter values. A vector of values (for a single parameter) or a matrix (for multiple parameters).

args.names

character list; arguments' names. Default option args.names = NULL uses column names from args.grid

ordered

logical: whether results should be ordered (cases with worst power rate or highest total cost are on top).

ncase

integer: number of cases to be subsetted, ignored if ordered = FALSE.

Examples

Run this code
# NOT RUN {
design <- cosa.crd2r2(rhots = 0, round = FALSE,
                      constrain = "es", power = .80,
                      cn1 = c(20, 10), cn2 = c(200, 50),
                      es = .25, rho2 = .10,
                      g2 = 3, r22 = .30,
                      n1 = NULL, n2 = NULL, p = NULL)

args.grid <- expand.grid(
  rho2 = seq(.15, .25, .05)
)

vectorize.cosa(design, args.grid = args.grid, ordered = FALSE)

# }

Run the code above in your browser using DataLab